home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / bas_int1.zip / DAYMONYR.BAS < prev    next >
BASIC Source File  |  1991-05-27  |  1KB  |  34 lines

  1. '===================================================================
  2. ' Quick Basic Forum
  3. '   Date : 28-Apr-91
  4. '   From : Dick Dennison
  5. 'Subject : Determine Date, Day, Month, Year using
  6. '          Call Interrupt
  7. '===================================================================
  8.  
  9. DECLARE SUB asmdate ()
  10. '$INCLUDE: 'qb.bi'
  11. DIM SHARED InRegs AS RegTypeX, outregs AS RegTypeX
  12. asmdate
  13.  
  14. SUB asmdate
  15. 'Works for days after 01/01/80.
  16. 'Interrupt 21 Function 2AH - get date
  17.  
  18. DIM day(7) AS STRING
  19. day$(0) = "Sun": day$(1) = "Mon": day$(2) = "Tue"
  20. day$(3) = "Wed": day$(4) = "Thu"
  21. day$(5) = "Fri": day$(6) = "Sat"
  22.  
  23.             InRegs.ax = (&H2A * 256)
  24.             CALL INTERRUPTX(&H21, InRegs, outregs)
  25.             ' cx is the year, dh is the month, dl is the date, al is the day
  26.             'PRINT OutRegs.cx; " = year"
  27.             'PRINT OutRegs.dx \ 256; " = month"
  28.             'PRINT OutRegs.dx MOD 256; " = date"
  29.             'PRINT OutRegs.ax MOD 256; " = day - 0 for Sun, 1 for Mon, etc."
  30.             daynum% = outregs.ax MOD 256
  31. PRINT day$(daynum%)
  32. END SUB
  33.  
  34.